#pragma once

#define BUF_SIZE 1024

#define FLUSH_NONE 0
#define FLUSH_LINE 1
#define FLUSH_FULL 2

struct m_IO_FILE {
    int flag; // Flush mode
    int status;
    int fileno; // file descriptor
    char buffer[BUF_SIZE]; // File buffer
    int cap;
    int size;
};

typedef struct m_IO_FILE mFILE ;

mFILE* mfopen(const char* filename, const char *mode);
int mfwrite(const void* ptr, int num, mFILE* stream);
void mfflush(mFILE* stream);
void mfclose(mFILE* stream);




